<html>
<head>
<title></title>
</head>
<body>
<script>
var session = null;
var endSession = function () {
  return session;
}
var setSession = function (theSession) {
  endSession();
  session = theSession;
};

navigator.presentation.startSession("remote.html").then(setSession).catch(endSession);

try {
    navigator.presentation.getAvailability().then(function() {
       document.write("Secondary display <font color=green>Available</font>.");
       document.title = "Available";
       done();
    }).catch(function() {
       document.write("Secondary display <font color=green>Unavailable</font>.");
       document.title = "Unavailable";
       done();
    });
    document.close();
  } catch(e) {
      document.title = "Fail";
  }
</script>
Presentation API: displayAvailable test
</body>
</html>
